package org.feiye.studyday18;

import java.util.Scanner;

public class ExceptionDemo {
	public static void main(String[] args) {
		try {
			Scanner in = new Scanner(System.in);
			double avg = 0;
			System.out.println("请输入一个学期的课程数：");
			int a = in.nextInt();
			System.out.println("请输入一个学期的课时数：");
			int b = in.nextInt();
			avg = b / a;
			System.out.println("平均学时是" + avg);
		} catch (Exception e) {
			System.err.println("输入异常！");
			e.printStackTrace();
		} finally {
			System.out.println("欢迎光临！");
		}

	}
}
